<!DOCTYPE html>
<html lang="en">
<head>
<#include "/common/head.ftl"/>
<script type="text/javascript">
	$(document).ready(function() {

	});
	function submitForm() {
		var userOldPassword = $.trim($("#userOldPassword").val());
		var userPassword = $.trim($("#userPassword").val());
		var userAgainPassword = $.trim($("#userAgainPassword").val());

		if (userOldPassword != "" && userPassword != ""
				&& userAgainPassword != "") {
			//$.post($("#form1").attr("action"), $("#form1").serialize(),function(data) {});
			if (userPassword.length >= 6 && userPassword.length <= 20) {
				if (userPassword == userAgainPassword) {
					$("#form1").submit();
				} else {
					$("#validateInfo").text("两次密码不一致!");
				}
			} else {
				$("#validateInfo").text("密码应该为6-20位数!");
			}

		} else {
			$("#validateInfo").text("请将信息填写完整!");
			return false;

		}
	}
</script>
</head>
<body>
	<#include "/common/header.ftl"/>
	<!-- 主内容 -->
	<div class="wrap">
		<div class="container">
			<div class="container-bd">

				<div class="modpass">
					<form id="form1" name="form1" method="post"
						action="${path}/user/pwdSave">
						<div class="modifyPsd">
							<div class="mp-head">
								<div class="reg-head-title f42">修改密码</div>
							</div>
							<div class="mp-form">
								<div class="line">
									<label>原始密码：</label>
									<div class="mp-inp dlb fr">
										<input type="password" class="mp-username"
											placeholder="请输入原始密码" id="userOldPassword"
											name="userOldPassword" value="" maxlength="20">
									</div>
								</div>
								<div class="line">
									<label>新&nbsp;&nbsp;密&nbsp;&nbsp;码：</label>
									<div class="mp-inp dlb fr">
										<input type="password" class="mp-psd" placeholder="请输入新密码"
											id="userPassword" name="userPassword" value="" maxlength="20" />
									</div>
								</div>
								<div class="line">
									<label>确认密码：</label>
									<div class="mp-inp dlb fr">
										<input type="password" class="mp-psd-again"
											placeholder="请再次输入新密码" id="userAgainPassword"
											name="userAgainPassword" value="" maxlength="20" />
									</div>
								</div>
								<div>
									<span id="validateInfo" style="color: red;"></span>
								</div>
								<div>
									<span style="color: red;">${message!''}</span>
								</div>
								<div class="btn-save">
									<input type="button" value="保存" class="common_btn"
										onclick="submitForm();" />
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<#include "/common/footer.ftl"/>
</body>
</html>